import os
import logging

SECRET_KEY = 'thisGGisRRa12secret'

STATIC_PATH = os.path.join(os.path.dirname(__file__), "./static")
TEMPLATE_PATH = os.path.join(os.path.dirname(__file__), "./templates")

DB_USER = 'root'
DB_HOST = '127.0.0.1'
DB_PWD = '248536'
DB_PORT = 3306
DB_NAME = 'give_me_some_time'

ADMIN_NAME = 'admin'
ADMIN_PASSWD = 'admin'

# service logger

service_logger = logging.getLogger("service log")
service_logger.setLevel(logging.DEBUG)

fh = logging.FileHandler('log/info.log', 'a')
fh.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s', "%Y-%m-%d %H:%M:%S")
fh.setFormatter(formatter)
ch.setFormatter(formatter)

service_logger.addHandler(fh)
service_logger.addHandler(ch)
